Function.prototype.myApply = function (context = window, args) {
    if (typeof this !== "function") {
        return new Error("not myself")
    }
    let x = Symbol();
    context[x] = this
    let result = context[x](...args)
    delete context[x]
    return result
}


Function.prototype.myCall = function (context = window, args) {
    if (typeof this !== "function") {
        return new Error("not myself")
    }
    let x = Symbol();
    context[x] = this
    let result
    if (Array.isArray(args)) {
        result = context[x](args)
    } else {
        result = context[x]()
    }
    delete context[x]
    return result
}



Function.prototype.myBind = function (context = window, args) {
    if (typeof this !== "function") {
        return new Error("not myself")
    }
    return function (...args) {
        let x = Symbol();
        context[x] = this
        let result = context[x](...args)
        delete context[x]
        return result
    }
}